<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/static/jQuery-1.11/jquery-1.11.3.min.js"></script>
</head>
<body>
<script>
    $(function () {
        $("#submit").click(function () {
            var username = $("#username").val();
            var password = $("#password").val();
            var param = "username=" + username + "&password=" + password;
            $.post("/user/login", param, function (data) {
                if (data.success){
                    location.href = "/employee/list";   // 访问 employee
                    // location.href = "/department/list";      // 访问 product
                    // location.href = "http://wolfcode.cn"; // 跳外域
                }else {
                    $("#p").html(data.msg).css('color', 'red');
                }
            });
        })
    })
</script>
<h3>请登录</h3>
    <span id="p"></span><br/>
    用户名：<input type="text" name="username" id="username"><br/>
    密码：<input type="password" name="password" id="password"><br/>
    <input id="submit" type="submit" value="登录"/> <a href="/static/mytext/register.html">没有账号，点击注册</a>

</body>
</html>